/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Extras;

import javax.swing.JOptionPane;

/**
 *
 * @author gustavokatel
 */
public class Nums_numa_matriz {
    
    public static void main(String[] args)
    {
        int[] lista = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};//new int[20];
        int i=0,j=i+4; String res = "";
        
        while(j<=lista.length)
        {
            for(;i<j;i++)
            {
                String c="";
                if(lista[i]<10)
                {
                    c="0"+String.valueOf(lista[i]);
                }
                else
                {
                    c=String.valueOf(lista[i]);
                }
                res=res+c+" ";
            }
            res=res+"\n";
            j=j+4;
        }
        
        JOptionPane.showMessageDialog(null, res);
    }
    
}
